package vn.fpt.fsoft.entities;


/**
 * Author DuongPV1
 * Entity TrustDistrict mapping with TrusDistrict table 
 * */
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Nation")
public class Nation implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 952292910951428650L;
	private int nationId;
	private String nationName;
	private Set<TrustRegion> trustRegions = new HashSet<TrustRegion>(0);
	private Set<County> counties = new HashSet<County>(0);

	public Nation() {
		// TODO Auto-generated constructor stub
	}

	
	@Id
	@GeneratedValue
	@Column(name="NationId",nullable=false,unique=true)
	public int getNationId() {
		return nationId;
	}

	public void setNationId(int nationId) {
		this.nationId = nationId;
	}
	@Column(name="NationName")
	public String getNationName() {
		return nationName;
	}

	public void setNationName(String nationName) {
		this.nationName = nationName;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="nation")
	public Set<TrustRegion> getTrustRegions() {
		return trustRegions;
	}

	public void setTrustRegions(Set<TrustRegion> trustRegions) {
		this.trustRegions = trustRegions;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="nation")
	public Set<County> getCounties() {
		return counties;
	}

	public void setCounties(Set<County> counties) {
		this.counties = counties;
	}
	

}
